projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86cceab
)
GtkColorSwatch: Respect an explicitly set size
author
Matthias Clasen
<mclasen@redhat.com>
Thu, 10 Jul 2014 00:44:06 +0000
(20:44 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Thu, 10 Jul 2014 00:44:06 +0000
(20:44 -0400)
This will let us use a suitably sized color swatch in the color
button.
gtk/gtkcolorswatch.c
patch
|
blob
|
history
diff --git
a/gtk/gtkcolorswatch.c
b/gtk/gtkcolorswatch.c
index ccee3ea122d6ee19ae7c335965f3c358644c3ecc..2f97f94fc76a47db6066afcadcf17c1f122be2bb 100644
(file)
--- a/
gtk/gtkcolorswatch.c
+++ b/
gtk/gtkcolorswatch.c
@@
-353,7
+353,14
@@
swatch_get_preferred_width (GtkWidget *widget,
gint *min,
gint *nat)
{
- *min = *nat = 48;
+ gint w, h;
+
+ gtk_widget_get_size_request (widget, &w, &h);
+
+ if (w < 0)
+ w = 48;
+
+ *min = *nat = w;
}
static void
@@
-361,7
+368,14
@@
swatch_get_preferred_height (GtkWidget *widget,
gint *min,
gint *nat)
{
- *min = *nat = 32;
+ gint w, h;
+
+ gtk_widget_get_size_request (widget, &w, &h);
+
+ if (h < 0)
+ h = 32;
+
+ *min = *nat = h;
}
static gboolean